function showUserDetails(argMid){
	
	var showDetails = document.getElementById(argMid);
	showDetails.style.display = "inherit";
	
	var sourceId = window.event;

}

function hideUserDetails(id){
	// Experimentell
	var showDetails = document.getElementById(id);
	showDetails.style.display = "none";	
	
}

function showAddUserDialogue(){
	var show = document.getElementById("adduser");
	show.style.display = "inherit";
}

function newusercancel(){
	var hide = document.getElementById("adduser");
	hide.style.display = "none";	
}

function useradmin(){

	var height = window.innerHeight;
	var width = window.innerWidth;
	
	/*
	 * Overlay
	 */
	var overlay = document.getElementById("overlay");
	overlay.style.position = "absolute";
	overlay.style.left = "0";
	overlay.style.top = "0";
	overlay.style.width = width + "px";
	overlay.style.height = height + "px";
	
	overlay.style.backgroundColor = "#909090";
	
	/*
	 * New User Dialogue
	 */
	var login = document.getElementById("adduser");
	login.style.position = "absolute";
	
	var posHor = (width) / 2 - 250;
	var posVer = 50;
	// login.style.zIndex = "1000";
	login.style.left = posHor + "px";
	login.style.top = posVer + "px";
	
	/*
	 * New User Cancel
	 */
	var cancel = document.getElementById("newusercancel");
	cancel.style.position = "absolute";
	
	var posHor = (width) / 2 - 250;
	var posVer = 50;
	// login.style.zIndex = "1000";
	login.style.left = posHor + "px";
	login.style.top = posVer + "px";
	
	/*
	 * New User Button
	 */
	var newuserbutton = document.getElementById("adduserbutton");
	newuserbutton.style.position = "absolute";
	var posHor = width - 120;
	var posVer = 0;
	newuserbutton.style.left = posHor + "px";
	newuserbutton.style.top = posVer + "px";

	/*
	 * UserButtons
	 */
	var buttons = document.getElementsByClassName("edituser");
	var posHor = (width)/2 - 400;
	for(var i = 0; i < buttons.length; i++){
		buttons[i].style.position = "relative";
		buttons[i].style.left = posHor + "px";
		
	}
	
	/*
	 * User Edit Dialogue
	 */
	var editors = document.getElementsByClassName("userdetails");
	var posHor = (width)/2 - 400;
	for(var i = 0; i < editors.length; i++){
		editors[i].style.position = "relative";
		editors[i].style.left = posHor + "px";
		
	}
}

function logout(){
	
	window.location.href = "index.php?logout=true";

}

function index(){
	
	var height = window.innerHeight;
	var width = window.innerWidth;
	
	/*
	 * Overlay
	 */
	var overlay = document.getElementById("overlay");
	overlay.style.position = "absolute";
	overlay.style.left = "0";
	overlay.style.top = "0";
	overlay.style.width = width + "px";
	overlay.style.height = height + "px";
	
	overlay.style.backgroundColor = "#909090";
	
	var welcome = document.getElementById("welcome");
	welcome.style.position = "absolute";
	welcome.style.left = "0";
	welcome.style.top = "0";
	welcome.style.width = width - 200 + "px";
	
	var logout = document.getElementById("logout");
	logout.style.position = "absolute";
	var left = width - 200;
	logout.style.left = left;
	logout.style.right = "0";
	logout.style.top = "0";
	
	var overlay = document.getElementById("menulist");
	overlay.style.position = "absolute";
	overlay.style.left = "0";
	overlay.style.top = "20%";
	overlay.style.width = width + "px";
	overlay.style.height = "80%";
}

function noaccess(){
	
	var height = window.innerHeight;
	var width = window.innerWidth;
	
	/*
	 * Overlay
	 */
	var overlay = document.getElementById("overlay");
	overlay.style.position = "absolute";
	overlay.style.left = "0";
	overlay.style.top = "0";
	overlay.style.width = width + "px";
	overlay.style.height = height + "px";
	
	overlay.style.backgroundColor = "#909090";
		
	/*
	 * No Access
	 */
	var nologin = document.getElementById("noaccess");
	nologin.style.position = "absolute";

	var posHorA = (width)/2 - 250;
	var posVerA = (height)/2 - 200;
	
	nologin.style.zIndex = "1000";
	nologin.style.left = posHorA + "px";
	nologin.style.top = posVerA + "px";
	
}

function overlay() {
	
	var height = window.innerHeight;
	var width = window.innerWidth;
	
	/*
	 * Overlay
	 */
	var overlay = document.getElementById("overlay");
	overlay.style.position = "absolute";
	overlay.style.left = "0";
	overlay.style.top = "0";
	overlay.style.width = width + "px";
	overlay.style.height = height + "px";
	
	overlay.style.backgroundColor = "#909090";
	
	/*
	 * Login Window
	 */
	var login = document.getElementById("loginWindow");
	login.style.position = "absolute";

	var posHor = (width)/2 - 250;
	var posVer = (height)/2 - 200;
	
	login.style.zIndex = "1000";
	login.style.left = posHor + "px";
	login.style.top = posVer + "px";
	
	/*
	 * Login Logo
	 */
	var logo = document.getElementById("loginLogo");
	logo.style.position = "absolute";

	var posHor = (width)/2 - 300;
	var posVer = (height)/2 - 250;
	
	logo.style.zIndex = "2000";
	logo.style.left = posHor + "px";
	logo.style.top = posVer + "px";
	
	/*
	 * Login Username
	 */
	var user = document.getElementById("userForm");
	user.style.position = "relative";

	var posHor = "50";
	var posVer = "100";
	// user.style.zIndex = "2000";
	user.style.left = posHor + "px";
	user.style.top = posVer + "px";
	user.style.width = "400px";
	user.style.height = "50px";
	user.style.fontSize = "3em";
	
	/*
	 * Login Password
	 */
	var pass = document.getElementById("userPass");
	pass.style.position = "relative";

	var posHor = "50";
	var posVer = "150";
	// pass.style.zIndex = "2000";
	pass.style.left = posHor + "px";
	pass.style.top = posVer + "px";
	pass.style.width = "400px";
	pass.style.height = "50px";
	pass.style.fontSize = "3em";
	
	/*
	 * Login Button
	 */
	var butt = document.getElementById("passOK");
	butt.style.position = "relative";

	var posHor = "50";
	var posVer = "200";
	// butt.style.zIndex = "2000";
	butt.style.left = posHor + "px";
	butt.style.top = posVer + "px";
	butt.style.width = "400px";
	butt.style.height = "50px";
	butt.style.fontSize = "2.5em";
	
}

function clearUser(){
	var field = document.getElementById("userForm");
	field.value = "";
}
function clearPass(){
	var field = document.getElementById("userPass");
	field.value = "";	
}
function clearNewFirstname(){
	var field = document.getElementById("firstname");
	field.value = "";
}
function clearNewGivenname(){
	var field = document.getElementById("givenname");
	field.value = "";
}
function clearNewUsername(){
	var field = document.getElementById("username");
	field.value = "";
}
function clearNewPassword(){
	var field = document.getElementById("password");
	field.value = "";
}
